<template>
	<view>
		<scroll-view class="container" :scroll-y="true">
			<u--text class="tips_text" text="发起回收前，请您仔细阅读以下《产品类型及等级分类》说明书"></u--text>
			<image src="/static/flhs.jpg" class="manualImg"  mode="widthFix"></image>
      <view style="margin: 30px 0">
        <view @click="addPageDetaila" style="width: 60%;margin: 0 auto;text-align: center;font-size: 14px;background-color:#1e4c9a;color: white;padding: 6px 0;border-radius: 5px">
          <text style="vertical-align: middle">点击此处查看图片组</text>
          <image src="../../static/dianji.png" style="width: 24px;height: 24px;margin-left: 5px;vertical-align: middle"></image>
        </view>
      </view>
      <view class="" style="margin: 30px 0">
        <u-button type="primary" text="已清楚回收分级，发起回收" @tap="createRecycle"></u-button>
      </view>
		</scroll-view>
<!--		<view class="bottomBtnDiv">-->
<!--			<view class="bottomBtn">-->
<!--				<u-button type="primary" text="已清楚回收分级，发起回收" @tap="createRecycle"></u-button>-->
<!--			</view>-->
<!--		</view>-->
		<customTabbar tabVal="recycle/recycle" />
	</view>
</template>

<script>
	import customTabbar from '@/components/custom_tabbar.vue'
  import { mapState } from 'vuex';
  import {getAddress, getUserInfo} from "../../api/user";
	export default {
		components: {
			customTabbar
		},
    onShareAppMessage() {
      return{
        title:'科动赫',
        path:'/pages/index/index'
      }
    },
    computed: {
      ...mapState(['user']),
      ...mapState({
        user: state => state.user,
      })
    },
		data() {
			return {

			};
		},
		methods: {
      addPageDetaila(){
        uni.navigateTo({
          url: "/pagesA/imgDetail/imgDetail"
        })
      },
			createRecycle() {
        let data = { ...this.user }
        getUserInfo().then((res) => {
            console.log('用户信息',res)
            if(res.code === 0){
                uni.navigateTo({
                  url: "/pages/recycle/create_recycle"
                })
            }else{
              console.log('token不对了,应该去登录')
              this.$store.commit('setUser', null);
              this.goLogin()
            }
          })

        // if(this.user){
        //   uni.navigateTo({
        //     url: "/pages/recycle/create_recycle"
        //   })
        // }else{
        //   uni.navigateTo({
        //     url: "/pagesB/Login/index"
        //   })
        // }
			},
      goLogin() {
        uni.navigateTo({
          url: "/pagesB/Login/index"
        })
      }
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		//padding-bottom: 108rpx;

		.tips_text {
			flex-grow: 0;
			flex-shrink: 0;
			height: 80rpx;
		}

		.manualImg {
			flex-grow: 1;
			padding-top: 32rpx;
			margin: 0 auto;
			width: 700rpx;
			height: 1102.5rpx;
			display: block;
		}
	}
</style>
